package com.restdoc.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Xiao on 2017/9/20.
 */
@RestController
public class HelloController {

    @RequestMapping(value = "/hello",method = RequestMethod.GET)
    public Map hello(@RequestParam("page") String page, @RequestParam("per_page") String perPage){
        Map<String, String> map = new HashMap<>();
        map.put("hello", "true");
        return map;
    }

    @RequestMapping(value = "/hello2",method = RequestMethod.GET)
    public Map hello(){
        Map<String, String> map = new HashMap<>();
        map.put("gogo", "true");
        return map;
    }

    @RequestMapping(value = "/hello3",method = RequestMethod.POST)
    public Map hello3(){
        Map<String, String> map = new HashMap<>();
        map.put("three", "true");
        return map;
    }
}
